SELECT COUNT(1) FROM FD_DOMAIN_NA T WHERE T.CODE = :CODE<#if (ID!) != ''> AND T.ID <> :ID</#if>